<!DOCTYPE html>
<title>DOMException Polyfill Demo</title>
<meta charset="UTF-8">

<script src="../polyfill.js"></script>
<script src="../domexception.js"></script>
<script>
window.onload = function () {
  for (var c = 1; c <= 25; c += 1) {
    var tbody = document.querySelector('#rows'),
        tr = document.createElement('tr');

    function col(s, c) {
      var td = document.createElement('td');
      td.appendChild(document.createTextNode(s));
      tr.appendChild(td);
      td.className = c ? c : '';
    }

    var e = DOMException.create(c);
    col(c);
    col(e.code);
    col(e.name);
    col(e.message);
    var native = Object.prototype.toString.call(e) === '[object DOMException]';
    col(native, native ? 'yay' : 'boo');

    tbody.appendChild(tr);
  }
};
</script>

<style>
body { font-family: sans-serif; }
th { text-align: left; }
th, td { padding: 2px; }
tr:nth-child(even) { background-color: #eeeeee; }
tr:nth-child(odd) { background-color: #ccccee; }
td.yay { color: #008000; font-weight: bold; }
td.boo { color: #800000; font-weight: bold; }
</style>

<table>
<tbody id="rows">
<tr><th>key<th>code<th>name<th>message<th>native?
</tbody>
</table>
